package rootpw;

import java.util.ArrayList;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.StringReader;
import java.util.StringTokenizer;

final class AgentListBuilder
{
	ArrayList<String> 		hl = new ArrayList<String>();
	ArrayList<String> 		pl = new ArrayList<String>();
	
	Object 					hosts[] = null;
	Object 					passwords[] = null;
	
	AgentListBuilder(String columnar) {
	
		String 				line = null;
		String				cipher = null;
		StringReader 		sr = null;
		BufferedReader 		br = null;
		StringTokenizer		st = null;
		int					i = 0;
		
		sr = new StringReader(columnar);
		br = new BufferedReader(sr);
		
		try {
			while ((line = br.readLine()) != null) {
				st = new StringTokenizer(line);
				hl.add(st.nextToken());
				cipher = "-----BEGIN PGP MESSAGE-----\n" + "Version: GnuPG v1.2.6 (GNU/Linux)\n\n" + st.nextToken() + "\n-----END PGP MESSAGE-----\n";
				pl.add(cipher);
				i++;
			}
			
		} catch (IOException e) {
	          e.printStackTrace();
	    }
		hosts = hl.toArray();
		passwords = pl.toArray();
	}
}
